<?php
namespace app\api\controller;
use think\Controller;
use think\Session;
use think\Db;
class Details extends Controller
{
    
    public function __construct(){
        header('Access-Control-Allow-Origin:*');
        header('Access-Control-Allow-Methods:GET, POST, OPTIONS');
    }
    public function finds() {
        $houseid=$_POST['houseid'];
        $res = Db::table("housedetails")->alias("a")
        ->join('houseimg i','a.house_id=i.house_id')
        ->field('a.house_price,a.house_type,a.house_lontiude,a.house_latiude,a.house_size,a.house_direction,a.house_wintype,a.house_des,i.img1,i.img2,i.img3,i.img4,i.img5')
        ->where('a.house_id','=',$houseid)->find();
        return json($res);
    }
    //判段是否被关注了
    public  function upstate(){
        $houseid=$_POST['houseid'];
        $ress=Db::name('user')->where('house_id','=',$houseid)
        ->find();
        return json($ress);
    }
}

